﻿using System.Threading.Tasks;

namespace Yto.Unitwork
{
    internal class InnerCompleteHandle : ICompleteHandle
    {
        private bool isComplete;
        private bool isDispose;

        public void Complete()
        {
            isComplete = true;
        }

        public Task CompleteAsync()
        {
            isComplete = true;
            return Task.FromResult(0);
        }

        public void Dispose()
        {
            if (isDispose)
            {
                return;
            }
            isDispose = true;
        }
    }
}